//
//  WYXListCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/7/16.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "WYXListCell.h"

@implementation WYXListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

+ (CGFloat)calculateHeightWith:(CommonWYXTagModel *)model {

    CGFloat top = 20;
    CGFloat titleHeight = 21;
    CGFloat distance = 5;
    CGFloat contentHeight = [Utilities getStringHeightWithText:model.labelDesc font:[UIFont systemFontOfSize:12] viewWidth:(TTScreenWidth-94.5)];
    
    if (contentHeight == 0) {
        contentHeight = 15;
    }
    
    CGFloat bottom = 10;
    return top + titleHeight + distance + contentHeight + bottom;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        
        [self.mainImageView pp_clipCorners:UIRectCornerAllCorners radius:self.mainImageView.frame.size.height/2];
    });
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
